package com.nowcoder.community.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

/**
 * @author cjh
 * @date 2023/2/10 - 15:50
 */
@Service
@Slf4j
public class AlphaService {
//    让方法在多线程下 被异步调用
    @Async
    public void execute1(){
      log.info("execute1");
    }

//    @Scheduled(initialDelay = 5000,fixedRate = 1000)
    public void execute2(){
        log.info("execute2");
    }

}
